package com.baifc.wiringbean.conditionbean;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.env.Environment;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * projectName: spring-in-action
 * packageName: com.baifc.wiringbean.conditionbean
 * Created: 2019/5/2.
 * Auther: baifc
 * Description:
 */
public class MagicExistsCondition implements Condition {
    public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
//        Environment environment = conditionContext.getEnvironment();
//
//        return environment.containsProperty("magic");
        return true;
    }
}
